<?php get_header(); ?>
<?php get_sidebar(); ?>
<div id="content">

	<?php if (have_posts()) : ?>
		
		<?php while (have_posts()) : the_post(); ?>
      
        <div class="post" id="post-<?php the_ID(); ?>">
        <?php if(function_exists(is_announcement)){
		$announcemenutIO=is_announcement();
		}else{
		$announcemenutIO=false;
		}?>
        <?php if($announcemenutIO): 
		// If post is an Announcement 
		?>
        
	<table width="320" border="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td width="20" height="50" valign="middle" bgcolor="#FFFFFF"><img src="images/announce.gif" alt="!" width="20" height="50" align="bottom" />   </td>
    <td width="430" valign="middle" background="images/slash.gif" bgcolor="#FFFFFF"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_permalink(); ?>"><span class="post-title">
      <?php the_title(); ?>
    </span></a><br />&nbsp;<?php announcement_banner(); ?></td>
  </tr>
</table>
  <div class="announce">
<?php the_content('ENTER','TRUE',''); ?><br /> <?php if(function_exists('the_views')) { the_views(); } ?>
</div>
   <?php else: ?>
     <table width="320" border="0" cellspacing="1" bgcolor="#000000">
  <?php $weekday_color = '#000000';
			  $weekday_text = '幾';
			  $weekday=get_the_time(w);
		switch ($weekday){
			case '0':
				$weekday_color = '#990000';
				$weekday_text = '日';
				break;
			case '1':
				$weekday_color = '#000000';
				$weekday_text = '壹';
				break;			
			case '2':
				$weekday_color = '#000000';
				$weekday_text = '貳';			
				break;			
			case '3':
				$weekday_color = '#000000';
				$weekday_text = '參';
				break;			
			case '4':
				$weekday_color = '#000000';
				$weekday_text = '肆';				
				break;			
			case '5':
				$weekday_color = '#000000';
				$weekday_text = '伍';
				break;			
			case '6':
				$weekday_color = '#006600';
				$weekday_text = '陸';
				break;				
		}
		?>
  <tr align="center" valign="middle">
    <td width="20" height="50" rowspan="2" align="center" bgcolor="#FFFFFF"><img src="images/time.gif" alt="time" width="20" height="50" align="bottom" /></td>
    <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">月</td>
    <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">日</td>
    <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">年</td>
    <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">時</td>
    <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">分</td>
    <td align="right" bgcolor="#000000" class="posttimetag"><div style="color:#FFFFFF"> <?php the_time('W'); ?>/<?php the_time('D'); ?></div></td>
  </tr>
  <tr align="center" valign="middle" bgcolor="#000000">
    <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('m'); ?></td>
    <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('d'); ?>
        </span></td>
    <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('y'); ?>
        </span></td>
    <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('H'); ?>
        </span></td>
    <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('i'); ?>
        </span></td>
    <td align="right" bgcolor="<?php echo($weekday_color); ?>" class="post-time-day"><?php echo($weekday_text) ?></td>
  </tr>
</table>
<table width="450" border="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td width="20" height="50" valign="middle" bgcolor="#FFFFFF"><img src="images/title.gif" alt="title" width="20" height="50" align="bottom" />   </td>
    <td width="430" valign="middle" background="images/post-title-bg.gif" bgcolor="#FFFFFF"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_permalink(); ?>"><span class="post-title">
      <?php the_title(); ?>
    </span></a></td>
  </tr>
</table>
 <table width="450" border="0" cellspacing="1" bgcolor="#000000">
<tr>
    <td width="20" height="50" rowspan="2" bgcolor="#FFFFFF"><img src="images/info.gif" alt="title" width="20" height="50" align="bottom" /></td>
    <td width="25" height="25" bgcolor="#FFFFFF"><div align="center"><img src="images/people_pix.png" alt="" /></div></td>
    <td width="146" bgcolor="#FFFFFF"><span class="postmetadata-big">
      <?php the_author_posts_link('namefl'); ?>
      <?php edit_post_link('edit', ' &#187 ', ''); ?><?php if(function_exists('the_views')) {' | '. the_views(); } ?>
    </span></td>
    <td width="25" height="25" bgcolor="#FFFFFF"><div align="center"><img src="images/catagory_pix.png" alt="類" /></div></td>
    <td bgcolor="#FFFFFF"><span class="postmetadata">
      <?php the_category(' | ') ?>
    </span></td>
</tr>
  <tr>
    <td width="25" height="25" bgcolor="#FFFFFF"><div align="center"><img src="images/comments_pix.png" alt="論" /></div></td>
    <td bgcolor="#FFFFFF"><span class="postmetadata-big">
      <?php comments_popup_link('請說 &#187 ', '留言(1)', '留言(%)'); ?>
    </span></td>
    <td width="25" height="25" bgcolor="#FFFFFF"><div align="center"><img src="images/tags_pix.png" alt="別" /></div></td>
    <td bgcolor="#FFFFFF"><span class="postmetadata">
      <?php the_tags('',' | ',''); ?>
    </span></td>
  </tr>
  </table>
  <div class="entry">
<?php the_content('Read More','TRUE',''); ?><br />
<li style="padding:0px; margin:0px; list-style:none; border: #dddddd solid 1px" ></li><br />
<?php if(function_exists('the_ratings')) {the_ratings(); } ?>
</div>
  <?php
   endif;
?>		  
	  </div>
	
		<?php endwhile; ?>

		<div class="navigation">
			<div class="alignleft post-title"><?php next_posts_link('&laquo; 前') ?></div>
			<div class="alignright post-title"><?php previous_posts_link('後 &raquo;') ?></div>
		</div>
		
	<?php else : ?>

		<h2 class="alert">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
		<?php include (TEMPLATEPATH . "/searchform.php"); ?>

	<?php endif; ?>
	<?php get_footer(); ?>
	</div>
	